<?php

namespace app\validate;

use think\Validate;

class Clue extends Validate
{
    /**
     * 线索库验证器
     */

    protected $rule = [
//        'person_name|姓名' => ['require'],
//        'person_id_card|身份证' => ['require','idCard'],
//        'mobile|手机号码' => ['mobile'],
//        'f_uid|负责人'=>['require']
    ];

    //手机号码验证
    public function sceneMobile()
    {

        return $this->only(['mobile'])
//            ->append('name|姓名','require')
            ->append('mobile|手机号码','require|mobile');
//            ->append('status|手机号码状态','require');
//            ->append('status|手机号码状态','number');
    }

    //其他证书验证
    public function sceneOtherCertificate()
    {
//        return $this->only(['certificate_id','certificate_period_of_validity','register'])
//            ->append('certificate_id|证书id','require')
//            ->append('certificate_id|证书id','number')
//
////            ->append('certificate_speciality|证书专业','require')
////            ->append('certificate_speciality|证书专业','number')
//
//            ->append('certificate_period_of_validity|证书有效期','require')
//            ->append('certificate_period_of_validity|证书有效期','date')
//
//            ->append('register|证书注册状态','require')
//            ->append('register|证书注册状态','number');
    }

    //沟通记录验证

    public function sceneCommunicate()
    {
//        return $this->only(['intention','call','communicate_content','communicate_date','communicate_uid'])
//            ->append('intention|意向结果','require')
//            ->append('call|呼叫结果','require')
//            ->append('communicate_content|沟通内容','require')
//            ->append('communicate_date|沟通时间','date')
//            ->append('communicate_uid|沟通人员','number');
    }

    //验证身份证
    public function sceneIdCard()
    {

        return $this->only(['id_card'])
            ->append('id_card|身份证','idCard');
    }
    public function scenePersonIdCard()
    {

        return $this->only(['person_id_card'])
            ->append('person_id_card|身份证','idCard|require');
    }


    //修改人才信息
    public function sceneEditPerson()
    {
//        return $this->only(['id','mobile','person_id_card'])
//            ->append('person_id_card','idCard|require')
//            ->append('mobile','require|mobile')
//            ->append('id','require');
    }
}